package QRCode.study.Config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 描述:
 *
 * @author Ychiha
 * @version 1.0
 * @date 15/1/2022 下午3:57
 */
@Configuration
public class webResourceConfig implements WebMvcConfigurer {

    /***
     * 添加文件处理器
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry){

        //addResourceHandler:浏览器访问的路径            addResourceLocations：本地路径
        registry.addResourceHandler("/qrcode/**").addResourceLocations("file:D:\\QRCode\\");

    }

}
